package com.hzhr.iot.device.service.helper;

import com.hzhr.iot.core.exception.ServiceException;
import com.hzhr.iot.device.model.collectDevice_code.CollectDevice_CodePutModel;
import com.hzhr.iot.device.service.CollectDevice_CodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

@Component
public class CollectDevice_CodeServiceHelper {
    @Autowired
    CollectDevice_CodeService collectDevice_codeService;

    public void putCodeByCollectDeviceId(Map<String, String> header,
                                         int collectDeviceId, String code) throws ServiceException {
        Map<String, Object> query = new HashMap<>();
        CollectDevice_CodePutModel body = new CollectDevice_CodePutModel();
        body.setCode(code);
        collectDevice_codeService.putByCollectDeviceId(header, collectDeviceId, query, body);
    }
}
